package com.jjlin.chapter_5;
import java.util.*;

public class CD104{

    //字符串的调整II
    public static String replace(char[] chars){
        if(chars == null || chars.length == 0)
            return "";
        int num = 0, len = 0;
        for(len = 0; len < chars.length && chars[len] != 0; len++){
            if(chars[len] == ' '){
                num++;
            }
        }

        int j = len + num * 2 - 1;
        char[] res = new char[j + 1];
        for(int i = len - 1; i >= 0; i--){
            if(chars[i] != ' ')
                res[j--] = chars[i];
            else{
                res[j--] = '0';
                res[j--] = '2';
                res[j--] = '%';
            }
        }
        return String.valueOf(res);
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        char[] chars = str.toCharArray();
        str = replace(chars);
        System.out.print(str);
    }
}
